// 入口文件
import "./mock"
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/style/global.less'
import showMsg from './utils/showMessage'
import vload from './directives/loading'
import lazy from './directives/lazy'
import bus from './eventBus'
Vue.directive("loading", vload)
Vue.directive("lazy", lazy)

Vue.prototype.$showMsg = showMsg;

// Vue.prototype.$bus = new Bus()


store.dispatch('setting/fetchSetting')

// import './api'

// window.showMsg = showMsg

// 测试纯DOM的操作  css module
// import styles from './assets/style/message.module.less'
// console.log(styles)
// const div = document.createElement("div")
// div.className = styles.message
// div.innerText = "assss"
// document.body.appendChild(div)

// 获取组件生成的根dom
// import Icon from "./components/Icon"
// const dom = getComponentRootDom(Icon, {type: 'home'})
// console.log(dom)
// function getComponentRootDom(comp, props){
//   const vm = new Vue({
//     render: h => h(comp, {props})
//   })
//   vm.$mount();
//   return vm.$el;
// }

// 扩展vue实例
// Vue.prototype.$nus = function name(params) {
//     console.log('nus')
// }


Vue.config.productionTip = false;

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
